package com.cskaoyan.mall.mapper;
import com.cskaoyan.mall.bean.GoodsExample;
import com.cskaoyan.mall.bean.bo.GoodsBO;
import com.cskaoyan.mall.bean.bo.GoodsCreateBO;
import com.cskaoyan.mall.bean.bo.GoodsLite4CreateBO;
import com.cskaoyan.mall.bean.vo.GoodsAttributesVO;
import com.cskaoyan.mall.bean.vo.GoodsItemsVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;

import com.cskaoyan.mall.bean.Goods;

/**
 *Created by Zsp
 *2021/1/9
 */
public interface GoodsMapper {
    long countByExample(GoodsExample example);

    int deleteByExample(GoodsExample example);

    /**
     * delete by primary key
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * insert record to table
     * @param record the record
     * @return insert count
     */
    int insert(Goods record);

    /**
     * insert record to table selective
     * @param record the record
     * @return insert count
     */
    int insertSelective(Goods record);

    List<GoodsItemsVO> selectByExample(GoodsExample example);

    /**
     * select by primary key
     * @param id primary key
     * @return object by primary key
     */
    Goods selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Goods record, @Param("example") GoodsExample example);

    int updateByExample(@Param("record") Goods record, @Param("example") GoodsExample example);

    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(Goods record);

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(Goods record);

    Integer selectAll();

    GoodsItemsVO selectGoodsDetailByPrimaryKey(Integer id);

    List<Integer> selectCategoryIds(Integer id);

    int updateByGoodsBOSelective(GoodsBO goodsBO);

    int insertCreateGoodsSelective(GoodsLite4CreateBO goodsLite4CreateBO);

}
